Program Description

As the name implies, this program is an example of p4's send/receive functionality. Briefly, it is a simple program that runs a master process and some slave processes. The master and the set of slaves form a ring of processes in which the master reads a message from stdin and sends a copy of the message to the first slave, which passes it on; the last slave passes the message back to the master. If the master receives an undamaged copy of the message, it assumes that all went well, and reads another message. Note that the ring of processes is a logical structure in which each process assumes that its predecessor in the ring is the process with the next lower id, and its successor is the process with the next higher id. The master has id 0 (zero) and has the process with the largest id as its predecessor.

Analysis of the Program, ,A Message-Passing Example,Getting Started